
public class LeakyBucketMain {
	public static void main(String[] args) {
		// listen on port inPort, send to args[1],
		// max. size of received packet is 1490 bytes,
		// buffer capacity is 2000*1490 bytes,
		// leaky bucket has bucketSize tokens, rate bucketRate tokens/sec, and
		// records packet arrivals in log file).

		try{
        int inPort = Integer.parseInt(args[0]);
        int maxPacketSize = 1490;
        int bucketSize = Integer.parseInt(args[2]);
        int bucketRate = Integer.parseInt(args[3]);

		LeakyBucket lb = new LeakyBucket(inPort, args[1],
		maxPacketSize, 2000*maxPacketSize, bucketSize, bucketRate, args[4]);
		System.out.println("View logs in "+args[4]);
		new Thread(lb).start();
		}
		catch(Exception e){
			System.err.println("Usage- \n java LeakyBucketMain <LeakyBucketPort> <ReceiverIP> <bucketSize> <bucketRate/sec> <logFilePath>");
		}
		}
}
